package com.papers.juan.service;

import com.papers.common.core.domain.PageQuery;
import com.papers.common.core.domain.R;
import com.papers.common.core.page.TableDataInfo;
import com.papers.juan.domain.bo.TJuanQuestionBo;
import com.papers.juan.domain.dto.InsertQuestion;
import com.papers.juan.domain.dto.JuanQuestionDto;
import com.papers.juan.domain.vo.KnowledgeReturnVO;
import com.papers.juan.domain.vo.QuestionVO;
import com.papers.juan.domain.vo.StatisticsByTypeVO;
import com.papers.juan.domain.vo.TJuanQuestionVo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.util.Collection;
import java.util.List;

/**
 * 题目Service接口
 *
 * @author papers
 * @date 2022-10-08
 */
public interface ITJuanQuestionService {

    /**
     * 查询题目
     */
    TJuanQuestionVo queryById(String questionId);

    /**
     * 查询题目列表
     */
    TableDataInfo<TJuanQuestionVo> queryPageList(TJuanQuestionBo bo, PageQuery pageQuery);

    /**
     * 查询题目列表
     */
    List<TJuanQuestionVo> queryList(JuanQuestionDto bo,PageQuery pageQuery);

    /**
     * 新增题目
     */
    Boolean insertByBo(TJuanQuestionBo bo);

    /**
     * 修改题目
     */
    Boolean updateByBo(TJuanQuestionBo bo);

    /**
     * 校验并批量删除题目信息
     */
    Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);

    R getQuestionList(JuanQuestionDto bo, PageQuery pageQuery);

    R getQuestionByIds(String ids);

    R getChapterTreeByQuestion(String courseId);

    R getKnowledgeTreeByQuestion(String courseId);

//    R importQuestions(MultipartFile file);

    void importExcell(List<TJuanQuestionVo> voList,String tk);

    R<Void> addQuestion(InsertQuestion bo);

    R<Void> editQuestion(TJuanQuestionBo bo);

    void exportJson(JuanQuestionDto bo, HttpServletResponse rep) throws UnsupportedEncodingException;

    boolean importJson(MultipartFile file);

    List<KnowledgeReturnVO> statisticsByKnowledge(String courseId);

    List<StatisticsByTypeVO> getStatisticsByType(String courseId,String type);

    QuestionVO getStatisticsByRelevance(String courseId);

    List<StatisticsByTypeVO> getStatisticsByLevel(String courseId, String type);

    List<StatisticsByTypeVO> getStatisticsByEasy(String courseId, String type);

    List<KnowledgeReturnVO> getStatisticsByPoint(String courseId);

    List<StatisticsByTypeVO> getStatisticsByImportance(String courseId, String type);

    R getKnowledgeTreeByQuestion1(String courseId);

    R getQuestionListNew(JuanQuestionDto dto, PageQuery pageQuery);

    List<TJuanQuestionVo> selectQuestionList(JuanQuestionDto bo);
}
